package com.ape.mapsa.produccion.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

/**
 * The persistent class for the dep_item_print_specs database table.
 * 
 */
@Entity
@Table(name = "dep_item_print_specs")
public class DepItemPrintSpec implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	@Column(name = "cant_color")
	private String cantColor;

	private int cilindro;

	@Type(type = "org.hibernate.type.NumericBooleanType")
	private boolean dorso;
	@Type(type = "org.hibernate.type.NumericBooleanType")
	private boolean frente;

	private String text;

	// bi-directional many-to-one association to Item
	@OneToMany(mappedBy = "depItemPrintSpec")
	private List<Item> items;

	public DepItemPrintSpec() {
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCantColor() {
		return this.cantColor;
	}

	public void setCantColor(String cantColor) {
		this.cantColor = cantColor;
	}

	public int getCilindro() {
		return this.cilindro;
	}

	public void setCilindro(int cilindro) {
		this.cilindro = cilindro;
	}

	public boolean getDorso() {
		return this.dorso;
	}

	public void setDorso(boolean dorso) {
		this.dorso = dorso;
	}

	public boolean getFrente() {
		return this.frente;
	}

	public void setFrente(boolean frente) {
		this.frente = frente;
	}

	public String getText() {
		return this.text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public List<Item> getItems() {
		return this.items;
	}

	public void setItems(List<Item> items) {
		this.items = items;
	}

	public Item addItem(Item item) {
		getItems().add(item);
		item.setDepItemPrintSpec(this);

		return item;
	}

	public Item removeItem(Item item) {
		getItems().remove(item);
		item.setDepItemPrintSpec(null);

		return item;
	}

	@Override
	public String toString() {
		return "DepItemPrintSpec [id=" + id + ", cantColor=" + cantColor + ", cilindro=" + cilindro + ", dorso=" + dorso + ", frente=" + frente
				+ ", text=" + text + "]";
	}

}